package Q5;

import java.io.File;
import java.io.Serializable;
import java.net.InetAddress;

public class Message implements Serializable {
    private static final long serialVersionUID = -1494386113330853810L;
    String content;
    File file;
    private InetAddress name;

    public Message(String content, File file, InetAddress name) {
        this.content = content;
        this.file = file;
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public File getFile() {
        return file;
    }

    public InetAddress getName() {
        return name;
    }
    public String getFileName(){
        if(null != file){
            return file.getName();
        }else {
            return "没有文件";
        }
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setFile(File file) {
        this.file = file;
    }
}
